import request from '@/utils/request'

// 查询平台配置列表
export function listPlatformConfig (query) {
  return request({
    url: '/platform/platformConfig/list',
    method: 'get',
    params: query
  })
}

// 查询平台配置详细
export function getPlatformConfig (id) {
  return request({
    url: '/platform/platformConfig/' + id,
    method: 'get'
  })
}

// 新增平台配置
export function addPlatformConfig (data) {
  return request({
    url: '/platform/platformConfig',
    method: 'post',
    data: data
  })
}

// 修改平台配置
export function updatePlatformConfig (data) {
  return request({
    url: '/platform/platformConfig',
    method: 'put',
    data: data
  })
}

// 删除平台配置
export function delPlatformConfig (id) {
  return request({
    url: '/platform/platformConfig/' + id,
    method: 'delete'
  })
}


// 校验键是否存在
export function checkCodeUnique (id, code) {
  if (id === undefined) {
    id = ''
  }
  return request({
    url: '/platform/platformConfig/checkCodeUnique/' + code + '/' + id,
    method: 'get'
  })
}


// 导出平台配置
export function exportPlatformConfig (query) {
  return request({
    url: '/platform/platformConfig/export',
    method: 'get',
    params: query
  })
}

// 获取初始化数据
export function getInitData (dictTypes) {
  return request({
    url: '/platform/platformConfig/getInitData/' + dictTypes,
    method: 'get'
  })
}
